package com.kl.forum.service;

import com.kl.forum.dao.ReportMapper;
import com.kl.forum.entity.Report;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class ReportService {
    @Autowired
    private ReportMapper reportMapper;

    public int insert(Integer userId, Integer accusedUserId,Integer reportType, Integer articleId,String content){
        Report report=new Report();
        report.setCreateTime(new Date());
        report.setAccusedUserId(accusedUserId);
        report.setArticleId(articleId);
        report.setReportType(reportType);
        report.setUserId(userId);
        report.setContent(content);
    return     reportMapper.insertSelective(report);
    }

}
